# Contributor: Eric Kidd <git@randomhacks.net>
# Maintainer: Holger Jaekel <holger.jaekel@gmx.de>
pkgname=geos
pkgver=3.12.1
pkgrel=0
pkgdesc="GEOS is a library providing OpenGIS and JTS spatial operations in C++."
url="https://libgeos.org/"
arch="all"
license="LGPL-2.1-or-later"
makedepends="cmake samurai"
subpackages="$pkgname-dev"
source="https://download.osgeo.org/geos/geos-$pkgver.tar.bz2"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=ON
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure -j${JOBS:-2}
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
192eba83c651e935b3c9a5cc19321285e4d28b9da9d7a1fa15d9471803027e630db7a7ecea96343d9c5f9846d279062ca3694fe47916a4ebf5698ae66dd5210d  geos-3.12.1.tar.bz2
"
